import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { pageStatisticsVO, alarmVO } from '@/api/home/types';

/**
 *  统计
 1、在线设备总数
 2、故障设备总数
 3、今日报警次数
 * @param
 * @returns {*}
 */
export const pageStatistics = (): AxiosPromise<pageStatisticsVO> => {
  return request({
    url: '/sry/home/page/statistics',
    method: 'post'
  });
};

/**
 *  重要报警信息滚动条
 * @param
 * @returns {*}
 */
export const pageRecentAlarm = (): AxiosPromise<alarmVO> => {
  return request({
    url: '/sry/home/page/recent/alarm',
    method: 'post'
  });
};

/**
 *  获取健康指数分布
 * @param
 * @returns {*}
 */
export const pageDistribution = (params: any): AxiosPromise<any> => {
  return request({
    url: '/sry/home/page/device/status/distribution',
    method: 'get',
    params: params
  });
};
